package org.vison.wonfu.framework.dao.p6spy;

import com.p6spy.engine.event.JdbcEventListener;
import com.p6spy.engine.spy.P6Factory;
import com.p6spy.engine.spy.P6SpyOptions;
import com.p6spy.engine.spy.option.P6OptionsRepository;
import lombok.extern.slf4j.Slf4j;
import com.p6spy.engine.spy.P6LoadableOptions;

@Slf4j
public class CustomeP6Factory implements P6Factory {

    @Override
    public P6LoadableOptions getOptions(P6OptionsRepository p6OptionsRepository) {
        log.info("p6spy 启动...");
        return new P6SpyOptions(p6OptionsRepository);
    }

    @Override
    public JdbcEventListener getJdbcEventListener() {
        return new P6spyListener();
    }
}